'''
Created on 07-Jan-2011
@author: Ashok
@note: Hoppity Hop!

To help test whether your puzzle submissions fit the guidelines, try this simple test puzzle. 
Your solution must follow the guidelines like any other puzzle. 
Write a program that takes as input a single argument on the command line. 
This argument must be a file name, which contains a single positive integer. 
The program should read this file and obtain the integer within, 
and then output a sequence of strings based upon the number (details below). 


Input specifications

The input file will contain a single positive integer (in base 10) 
expressed as a string using standard ASCII text 
(e.g. for example, the number "15" but without the double quotes). 
This number may or may not be padded on either side with white space. 
There will be no commas, periods, or any other non-numeric characters present within the number. 
The file may or may not terminate in a single new line character ("\n"). An example input file is below:
15



Output specifications

The program should iterate over all integers (inclusive) from 1 to the number expressed by the input file. 
For example, if the file contained the number 10, the submission should iterate over 1 through 10. 
At each integer value in this range, the program may possibly (based upon the following rules) 
output a single string terminating with a newline. 

For integers that are evenly divisible by three, output the exact string Hoppity, followed by a newline.
For integers that are evenly divisible by five, output the exact string Hophop, followed by a newline.
For integers that are evenly divisble by both three and five, do not do any of the above, 
    but instead output the exact string Hop, followed by a newline.

Example output (newline at end of every line):
Hoppity
Hophop
Hoppity
Hoppity
Hophop
Hoppity
Hop
'''
import sys

#Get the input file name
inFileName = sys.argv[-1]
#Open the file
try:
    inFile = open(inFileName, 'r')
except IOError:
    print "File open error, quiting now"
    exit(-1)
try:
    inNumStr = inFile.readline()
except ValueError:
    print "File empty, quitting now"
    exit(-1)
try:
    inNum = int(inNumStr.strip())
except ValueError:
    print "Invalid integer in file, quitting now"
    exit(-1)
for i in range (1, inNum):
    #print i, i%3, i%5
    if i%3 == 0 and i%5 == 0:
        print "Hop"
    elif i%3 == 0:
        print "Hoppity"
    elif i%5 == 0:
        print "Hophop"